package com.huilian.iotbox.data.enums;

import lombok.Getter;

/**
 * @author: loong
 * @create: 2023-06-05 11:46
 **/
@Getter
public enum TicketPackageTypeEnum {
    UNDATED(1, "不限时"),
    WEEK(2, "周卡"),
    MONTH(3, "月卡"),
    SEASON(4, "季卡"),
    YEAR(5, "年卡"),
    CUSTOMIZE(6, "自定义"),
    ;
    private Integer code;
    private String desc;

    TicketPackageTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getTicketPackageTypeDesc(Integer code) {
        for (TicketPackageTypeEnum value : TicketPackageTypeEnum.values()) {
            if (value.getCode().equals(code)) {
                return value.getDesc();
            }
        }
        return null;
    }
}
